package com.hgw.Demo04_BuilderPattern.Exercises6_7_4;

/**
 * Data time:2021/12/13 10:00
 * StudentID:2019112118
 * Author:hgw
 * Description:
 */
public abstract class Builder {

    protected Computer computer = new Computer();

    public abstract void buildCpu();
    public abstract void buildMemory();
    public abstract void buildHardDisk();
    public abstract void buildHost();
    public abstract void buildMonitor();

    // 钩子方法 ： 是否需要主机
    public boolean isHost() {
        return true;
    }
    // 钩子方法 ： 是否需要显示器
    public boolean isMonitor() {
        return true;
    }
    public Computer createComputer() {
        return computer;
    }
}
